package com.itheima.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class TypeController {
    //value和path 指定路径 建立路径与方法对应关系
    @RequestMapping({"/test01","/test02"})
    public String testType01(){
        System.out.println("testTyoe01...");
        return "success";
    }

    //method 请求方式 用什么方式访问此方法
    @RequestMapping(value = "/test03",method = RequestMethod.GET)
    public String testType02(){
        System.out.println("testTyoe02...");
        return "success";
    }

    //params 限定请求参数
    @RequestMapping(value = "/test04",params = {"username","password"})
    public String testType03(){
        System.out.println("testTyoe03...");
        return "success";
    }

    // 限定请求必须携带请求头
    @RequestMapping(value = "/test05",headers = {"user-agent"})
    public String testType04(){
        System.out.println("testTyoe04...");
        return "success";
    }
}
